<?php
// $Id$
/**
 * This file contains {@link QueryLanguage} which is part of the PHP Content 
 * Repository (phpCR), a derivative of the Java Content Repository JSR-170, and 
 * is licensed under the Apache License, Version 2.0.
 *
 * This file is based on the code created for
 * {@link http://www.jcp.org/en/jsr/detail?id=170 JSR-170}
 *
 * @author Travis Swicegood <travis@domain51.net>
 * @copyright PHP Code Copyright &copy; 2004-2005, Domain51, United States
 * @copyright Original Java and Documentation 
 *  Copyright &copy; 2002-2004, Day Management AG, Switerland
 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, 
 *      Version 2.0
 * @package phpContentRepository
 */


/**
 * Load the {@link phpCR} library file(s)
 */ 
require_once(dirname(__FILE__) . '/../phpCR.library.php');


/**
 * The query languages supported by the phpCR.
 *
 * This interface defines numeric constants for the following query languages:
 * <dl>
 *      <dt>JCRQL_SSES</dt>
 *      <dd>A SQL-like query language adapted for use in the phpCR and
 *          providing a "Simple Search Engine Syntax" (SSES) sub-language for
 *          full-text search which may be embedded in the SEARCH clause within
 *          the JCRQL query string.</dd>
 *
 *      <dt>XPath</dt>
 *      <dd>An implementation of the XPath language used for element
 *          selection in XML documents. It works by seeing the repository as
 *          an XML hierarchy. See the XML Views section of the
 *          specification.</dd>
 * </dl>
 *
 * The phpCR specification requires that at least one of the above query 
 * languages be supported.
 *
 * Discovery of supported query languages is done through 
 * {@link QueryManager::getSupportedQueryLanguages()} which returns an array
 * of object implementing this interface, {@link QueryLanguage}.
 *
 * Implementations may support additional query languages by providing an
 * implementation of this interface that extends the number of languages.
 *
 * In particular, an implementation may choose to support a variant of JCRQL
 * that embeds a full-text search language in the SEARCH clause other than SSES.
 * In such cases, the implementor should adhere to the convention of designating
 * the language "JCRQL_XYZ", where "XYZ" is the name of the embedded full-text
 * search language.
 *
 * @author PHP - Travis Swicegood <travis@domain51.net>
 * @copyright Copyright &copy; 2004-2005, Domain51
 * @package phpContentRepository
 */
interface QueryLanguage 
{
   /**
    * The int value of the JCRQL_SSES implementation.
    *
    * @var int
    */
    const JCRQL_SSES = 1;
    
    
   /**
    * The int value of the XPATH implementation.
    *
    * @var int
    */
    const XPATH = 2;
    
    
   /**
    * Returns the numerical constant identifying this query language.
    *
    * @return int
    */
    public function getValue();
    
    
   /**
    * Returns the descriptive name of query language.
    *
    * @return string
    */
    public function getName();
}

